<?php
//引入文件
include_once ("pdo.php");
//实例化
$obj=new Me("root","root");
//查询数据
$data=$obj->getAll("user");
$time=date("Y-m-d",time());
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<center>
    <table border="1">
        <tr>
            <td>角色id</td>
            <td>角色名称</td>
            <td>添加时间</td>
            <td>操作</td>
        </tr>
        <?php foreach($data as $key => $value ){?>
        <tr>
            <td><?php echo $value['user_id']?></td>
            <td><?php echo $value['user_name']?></td>
            <td><?php echo $time?></td>
            <td><a href="del.php? id=<?php echo $value['user_id'] ?>">删除</a></td>
        </tr>
        <?php }?>
    </table>
</center>
</body>
</html>
